cmake_minimum_required(VERSION 3.24)

# 设置项目名称和语言
project(xlitecore VERSION 1.0 LANGUAGES CXX)

set(SOURCES
    stdafx.cpp
    stdafx.h
    main.cpp
    src/cscoreglobal.cpp
    src/cscoreglobal.h
    src/csobject.cpp
    src/csobject.h
    src/csvariant.cpp
    src/csvariant.h
    src/csproperty.cpp
    src/csproperty.h
    src/csmethod.cpp
    src/csmethod.h
    src/csnotify.cpp
    src/csnotify.h
    src/cslinkedlist.cpp
    src/cslinkedlist.h
)

# 正确使用 SHARED 而不是 SHARE
add_library(xlitecore SHARED ${SOURCES})

# 指定输出目录
set_target_properties(xlitecore PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Startlite/core/xlitecore   # 设置 .dll 的输出目录
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Startlite/core/xlitecore   # 设置 .lib 的输出目录
)

# 如果需要包含目录，可以使用 target_include_directories
target_include_directories(xlitecore PRIVATE ./src)
target_include_directories(xlitecore PRIVATE .)

# 定义编译宏
target_compile_definitions(xlitecore PRIVATE CSCORE_EXPORTS)

# 添加包含目录（如果 DLL 提供了头文件）
target_include_directories(xlitecore PRIVATE
    ${CMAKE_SOURCE_DIR}/include  # 替换为头文件路径
)

